﻿<CustomWindow:EssentialWindow x:Class="Common.Controls.Viewer"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:CustomWindow="clr-namespace:CustomWindow;assembly=CustomWindow"
        Title="Viewer"
        xmlns:f="clr-namespace:AxShockwaveFlashObjects;assembly=AxInterop.ShockwaveFlashObjects"
        xmlns:my="clr-namespace:Common.Controls" Loaded="Window_Loaded" SizeToContent="WidthAndHeight" 
		ResizeMode="NoResize" AllowsTransparency="True" Background="{x:Null}" Foreground="{x:Null}">
    <Grid>
        <Border BorderThickness="16" CornerRadius="5" MouseDown="Border_MouseDown"  BorderBrush="#9957C6EF">
            <Grid Background="{StaticResource WindowBackgroundBrush}">
                <Grid Name="ImageViewerGrid">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Margin="4,4" Padding="4" CornerRadius="4" BorderBrush="#22000000">
                        <StackPanel Orientation="Horizontal">
                            <Button Content="原始大小" Click="Resize_Click" />
                            <Button Content="旋转" Click="Rotate_Click" />
                            <Button Content="外部编辑器" Visibility="Collapsed" />
                            <Button Content="下载原图" Click="Download_Click" />
                        </StackPanel>
                    </Border>
                    <Border Grid.Row="1">
                        <my:ImageViewer Margin="4"   x:Name="imageViewer" VerticalAlignment="Top" HorizontalAlignment="Left">
                        </my:ImageViewer>
                    </Border>
                </Grid>
                <Grid Name="VideoViewerGrid" Width="610" Height="500">
                </Grid>
                <Grid Name="MusicViewerGrid">
                    <StackPanel >
                        <Border BorderThickness="3" Background="Black">
                            <MediaElement MediaOpened="MusicPlayer_MediaOpened"  Loaded="MusicPlayer_Loaded" MediaEnded="MusicPlayer_MediaEnded" Name="MusicPlayer" LoadedBehavior="Manual"
              Volume="{Binding ElementName=volumeSlider, Path=Value}"
              MouseLeftButtonUp="mediaElement_MouseLeftButtonUp"/>
                        </Border>
                        <StackPanel Orientation="Horizontal" Height="25" HorizontalAlignment="Center">
                            <Button x:Name="playBtn" Content="播放" Margin="3,0,3,0" Click="playBtn_Click"/>
                            <Button x:Name="stopBtn" Content="停止" Margin="3,0,3,0"  Click="stopBtn_Click" />
                            <Button x:Name="volumeBtn" Content="音量" Margin="3,0,3,0" Click="volumeBtn_Click"/>
                            <Slider x:Name="volumeSlider" Minimum="0" Maximum="1" Value="0.5" Width="100" Visibility="Collapsed"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Height="25" HorizontalAlignment="Center">
                        <Slider Name="timelineSlider" Margin="5" Width="200" TickPlacement="BottomRight"/></StackPanel>
						<StackPanel Orientation="Horizontal" Height="25" HorizontalAlignment="Center">
                            <TextBlock Width="110" x:Name="txtTime" Foreground="{StaticResource ForegroundBrush}"/>
							</StackPanel>
                    </StackPanel>
                </Grid>
                <Grid Name="WebBrowserGrid" >
                </Grid>
            </Grid>
        </Border>
        <Border x:Name="WindowButtonsPlaceholder" HorizontalAlignment="Right" VerticalAlignment="Top" DockPanel.Dock="Right" Margin="0,0,16,0" />
    </Grid>
</CustomWindow:EssentialWindow>